/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;

/**
 * <p>Project: app2022 - Switch3
 * <p>Powered by webrx On 2022-01-07 10:20:32
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Switch3 {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        c.set(1, 2020);
        c.set(2, 2 - 1);
        int y = c.get(1);
        int m = c.get(2) + 1;
        int days = 31;
        switch (m) {
            case 2:
                days = y % 400 == 0 || y % 4 == 0 && y % 100 != 0 ? 29 : 28;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                days = 30;
                break;
        }

        System.out.printf("%d年%02d月有%02d天%n", y, m, days);
    }
}
